<?php
	$user_list = array();
	$permission_manager_list = array();
	foreach ($this->user_list as $user) {
		$user_list[$user['id']] = $user['username'];
	}
	foreach ($this->permission_manager_list as $user) {
		$permission_manager_list[$user['id']] = $user['username'];
	}
	$user_list = array_diff($user_list, $permission_manager_list);
	echo "<form method = 'Post' name = 'main_form'>";
	echo  $this->formHidden('mode','delete');
	echo  $this->formHidden('user_id');
	echo "</form>";
	echo $this->formSelect('user',1,array(),$user_list);
	echo $this->formButton('add','Thêm',array('onclick' => 'add_permission_manager()'));
	
	echo "<table style = 'width:100%;' class = 'table table-bordered table-striped'>";
	if ($permission_manager_list){
		echo "<tr class = 'tr2'>";
		echo "<th style ='width:40px;'>STT</th>";
		echo "<th align='left'>Tên</th>";
		echo "<th style ='width:100px;' align='center'>Xóa</th>";
		echo "</tr>";
		$i = 1;
		foreach ($permission_manager_list as $id => $user) {
			echo "<tr class = 'tr" . (($i%2) + 3) . "'>";
			echo "<td>" . $i . "</td>";
			echo "<td>" . $user . "</td>";
			echo "<td align='center'>" . $this->formButton('delete_' . $id,'Xóa',array('class' => 'btn_del','onclick' => 'delete_permission_manager(' . $id . ')')) . "</td>";
			echo "</tr>";
			$i++;
		}
	}else {
		echo "<tr>";
		echo "<td>Hiện chưa có dữ liệu</td>";
		echo "</tr>";
	}
	echo "</table>";